<?php 
include("includes/code_admin.php");
if (isset($_POST['id'])) {$id = $_POST['id']; }
if (isset($_POST['topmenu'])) {$topmenu = addslashes($_POST['topmenu']); }
if (isset($_POST['title'])) {$title = addslashes($_POST['title']); }
if (isset($_POST['text'])) {$text = addslashes($_POST['text']); }
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
<title><?php echo SITEURL; ?> Administrator</title>
<link href="style_admin.css" rel="stylesheet" type="text/css" />

</head>

<body>
<div id="container">
<table class="main" cellspacing="0" cellpadding="0">
  <tr>
    <td class="header">
    <!-- header start -->
    <?php include("includes/header.php");?>
    <!-- header finish -->
    </td>
  </tr>
  <tr>
    <td class="middle">&nbsp;</td>
  </tr>
  <tr>
    <td>
    <!-- tepa start -->
<?php include("includes/tepa.php"); ?>
    <!-- tepa finish -->
    </td>
  </tr>
  <tr>
    <td>
    <!-- contant start -->
<table class="content" cellspacing="0" cellpadding="0">
  <tr valign="top">
    <td>
    <!-- right col -->
<div class="right_col">
<h3 class="title">Sahifani o'zgartirish</h3>

<?php 
if(isset($id))
{
$result = mysql_query("UPDATE pages SET topmenu='$topmenu', title='$title', text='$text' WHERE id='$id'");
	if($result=='true') 
	{
		echo "<p class='ok'>Sahifa O'zgartirildi, OK</p> <br><center> <a href='page.php'><b>Yana o'zgartirish</b></a></center>"; 
	}
	else 
	{ 
		echo "<p class='error'>XATOLIK, Afsuski sahifa o'zgarmadi, qayta tekshiring yoki adminga xabar bering</p>";
	}
}
else
{
echo "<p class='error'><b>Xatolik, Siz sahifani tanlamagansiz <br /> <a href='page.php'>Bu yerni bosing</a></p>";
}
?>

</div>
	<!-- right col finish -->
    </td>
  </tr>
</table>

    <!-- contant finish -->
    </td>
  </tr>
</table>
<!-- futer start -->
<?php include("includes/futer.php"); ?>
<!-- futer finish -->
</div>
</body>
</html>
